<?php
ob_start();
include ('encabezado.php');
?>
<br>
<center>
	<table width="500" border="1" align="center" cellpadding="5" style="border-style:solid; border-collapse:collapse; border-color:Black">
		<tr style="background-color:Black">
			<th>Surname</th>
			<th>Name</th>
			<th>Password</th>
			<th>Group</th>
		</tr>
		<?php
			if (connectBD($ip, $userdb, $passworddb, $db))
			{
				$query = "SELECT Users.Name, Surname, Info, Groups.Name FROM Users INNER JOIN Groups on Users.GroupID = Groups.GroupID WHERE Groups.Name = '".$choosengroup."' ORDER BY Users.Surname";
				$result = mysql_query($query);
				while ($row = mysql_fetch_row($result))
				{
					echo "<tr><td style='border-color:Black' align='left'>".$row[1]."</td><td style='border-color:Black'>".$row[0]."</td><td align='center' style='border-color:Black'>".$row[2]."</td><td style='border-color:Black' align='center'>".$row[3]."</td></tr>";
				}
			}
			else
			{
				echo "Conex error!";
			}
		?>
	</table>
</center>
<?php
include ('pie.php');
ob_end_flush();
?>